# $Id: PKGBUILD 85228 2013-02-27 19:59:51Z andrea $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>

pkgname=processing
pkgver=2.0b8
pkgrel=1
arch=('x86_64' 'i686')
pkgdesc='Programming language and environment for creating images, animations and interactions'
url='http://www.processing.org/'
license=('GPL' 'LGPL')
depends=('libgl' 'sh' 'libxxf86vm')
makedepends=('gendesk')
options=(!strip)

if [ "$CARCH" == "x86_64" ]; then
  source=("http://$pkgname.googlecode.com/files/$pkgname-$pkgver-linux64.tgz"
          "$pkgname.png::http://wiki.$pkgname.org/skins/${pkgname}skin/${pkgname}_wiki_logo.png")
  sha256sums=('5eab47cd67f3160a71ff694b45e74f8a17f0b0ca31cd3ae545104fb70babb58e'
            '019ae700333409acbc628779747ab8f153f6647de25e4de3a9bd4a42d0d8056a')
else
  source=("http://$pkgname.googlecode.com/files/$pkgname-$pkgver-linux32.tgz"
          "$pkgname.png::http://wiki.$pkgname.org/skins/${pkgname}skin/${pkgname}_wiki_logo.png")
  sha256sums=('ba113199c5ca3c0d9a274088a62eacd6c3872dea9151e34ed1f312d78bad6f17'
            '019ae700333409acbc628779747ab8f153f6647de25e4de3a9bd4a42d0d8056a')
fi

build() {
  cd "$srcdir"

  gendesk
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  
  install -d "$pkgdir/usr/share/$pkgname/" "$pkgdir/usr/bin/"
  cp -r * "$pkgdir/usr/share/$pkgname/"
  ln -s "/usr/share/$pkgname/$pkgname" "$pkgdir/usr/bin/$pkgname"
  ln -s "/usr/share/$pkgname/$pkgname-java" "$pkgdir/usr/bin/$pkgname-java"
  install -Dm644 "$srcdir/$pkgname.png" \
    "$pkgdir/usr/share/pixmaps/$pkgname.png"
  install -Dm644 "$srcdir/$pkgname.desktop" \
    "$pkgdir/usr/share/applications/$pkgname.desktop"
}

# vim:set ts=2 sw=2 et:
